use cosmwasm_std::{HumanAddr, Uint128};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct InstantiateMsg {
    /// Owner if none set to info.sender.
    pub owner: Option<HumanAddr>,
    pub farm: Option<HumanAddr>,
    pub farm_hashcode: String,
    pub reward_contract: Option<HumanAddr>,
    pub reward_hashcode: String,
    pub stake_contract: Option<HumanAddr>,
    pub stake_hashcode: String,
    pub reward_limit: Uint128,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateConfig {
        new_owner: HumanAddr,
        new_farm: HumanAddr,
        reward_contract: HumanAddr,
        stake_contract: HumanAddr,
        reward_limit: Uint128,
    },
    Withdraw {},
    WithdrawReward {
        amount: Uint128,
    },
    WithdrawStake {
        amount: Uint128,
    },
    AddBankList {
        user_adr: HumanAddr,
    },
    RemoveBankList {
        user_adr: HumanAddr,
    },
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Config {},
    CheckBankList {
        user_adr: HumanAddr,
    },
    Staker {
        user: HumanAddr,
        block_time: u64,
        pool_id: u8,
    },
}
